<?php $this->pageTitle = Yii::app()->user->name; ?>
<div class="c_body">
	<div class="u_tabs ajaxLinks">
		<div class="u_tabs_head">
			<a class="u_tab  <?php if($current_tab=='allFriends'){ echo "curr"; } ?>" id="u_friends_tab1" href="<?php echo Yii::app()->createUrl('people/index', array('tab'=>'allFriends', 'profile'=>$profile)); ?>">Все друзья</a>
			<a class="u_tab  <?php if($current_tab=='onlineFriends'){ echo "curr"; } ?>" id="u_friends_tab2" href="<?php echo Yii::app()->createUrl('people/index', array('tab'=>'onlineFriends', 'profile'=>$profile)); ?>">Друзья онлайн</a>
			<?php if($profile == Yii::app()->user->id){ ?>
				<a class="u_tab  <?php if($current_tab=='requestFriends'){ echo "curr"; } ?>" id="u_friends_tab3" href="<?php echo Yii::app()->createUrl('people/index', array('tab'=>'requestFriends', 'profile'=>$profile)); ?>">Заявки в друзья</a>
			<?php } ?>
		</div>
		<div class="search_block cat_search_block">
			<form action="<?php echo Yii::app()->createUrl('people/index', array('tab'=>$current_tab, 'profile'=>$profile)); ?>" method="get" id="cat_search" rel="<?php echo Yii::app()->createUrl('people/index', array('tab'=>$current_tab, 'profile'=>$profile)); ?>">
				<div class="search_btn btn"><input type="submit" value="Найти" id="main_search_button" /></div>
				<div class="search_fld search-input">
					<div class="search_icon"></div>
					<input type="hidden" name="tab" value="<?php echo $current_tab; ?>" />
					<input type="text" name="text" value="<?php if($search){ echo $search; } ?>" placeholder="Начните вводить имя друга" id="search_text" />
				</div>
			</form>
		</div>		
	</div>

	<div class="tab <?php if($current_tab!='allFriends'){ echo "hidden"; } ?>" id="u_friends_tab1_">
		<div class="cat_head">
			<div class="cat_head_strip"></div>
			<div class="cat_head_h t"><p class="cat_head_h_txt">У вас <span><?php echo $countData['total']; ?></span> друзей</p></div>
		</div>
		<?php if($current_tab=='allFriends'){ ?>
			<div class="filter_block">
				<div class="filter_r">
					<form action="<?php echo Yii::app()->createAbsoluteUrl('people/getallfriends', array('limit'=>$limit, 'profile'=>$profile)); ?>" class="filter">
						<div class="form_head">Страна</div>
						<div class="select_block long">
							<select size="1" name="filter_country" id="filter_country">
								<option value="0">Выберите страну</option>
								<?php foreach($countries as $country){ ?>
									<option value="<?php echo $country->id; ?>"><?php echo $country->name; ?></option>
								<?php } ?>
							</select>
						</div>
						<div class="form_head">Возраст</div>
						<div class="select_block short">
							<select size="1" name="filter_age_from" id="filter_age_from" class="">
								<option value="0">От</option>
								<option value="10">10</option>
								<option value="15">15</option>
								<option value="17">17</option>
								<option value="18">18</option>
								<option value="20">20</option>
								<option value="22">22</option>
								<option value="25">25</option>
								<option value="28">28</option>
							</select>
						</div>
						<span class="select_bullit">&mdash;</span>
						<div class="select_block short">
							<select size="1" name="filter_age_to" id="filter_age_to" class="">
								<option value="0">До</option>
								<option value="15">15</option>
								<option value="17">17</option>
								<option value="18">18</option>
								<option value="20">20</option>
								<option value="22">22</option>
								<option value="25">25</option>
								<option value="28">28</option>
								<option value="30">30</option>
							</select>
						</div>
						<div class="clear"></div>
						<div class="checkbox_row">
							<div class="form_head">Пол</div>
							<div class="radio_block filter_sex_click">
								<div></div>
								<input type="radio" name="filter_sex" class="radio_item filter_sex" id="radio_female" value="W" />
								<label for="checkbox_female">Женский</label>
							</div>
							<div class="radio_block filter_sex_click">
								<div></div>
								<input type="radio" name="filter_sex" class="radio_item filter_sex" id="radio_male" value="M" />
								<label for="checkbox_male">Мужской</label>
							</div>
							<div class="radio_block filter_sex_click checked">
								<div></div>
								<input type="radio" name="filter_sex" class="radio_item filter_sex" id="radio_other" value="0" checked="checked" />
								<label for="checkbox_other">Любой</label>
							</div>
						</div>
					</form>
				</div>
				<div class="filter_l serchList">
					<?php $this->renderPartial('_allFriendsList',array(
						'people' => $data,
						'limit' => $limit,
						'offset' => $offset,
						'profile' => $profile							
					)); ?>				
				</div>
			</div>
		<?php } ?>
	</div>
					
	<div class="tab <?php if($current_tab!='onlineFriends'){ echo "hidden"; } ?>" id="u_friends_tab2_">
		<div class="cat_head">
			<div class="cat_head_strip"></div>
			<div class="cat_head_h t"><p class="cat_head_h_txt">У вас <span><?php echo $countData['total']; ?></span> друзей онлайн</p></div>
		</div>
		<?php if($current_tab=='onlineFriends'){ ?>
			<div class="filter_block">
				<div class="filter_r">
					<form action="<?php echo Yii::app()->createAbsoluteUrl('people/getonlinefriends', array('limit'=>$limit, 'profile'=>$profile)); ?>" class="filter">
						<div class="form_head">Страна</div>
						<div class="select_block long">
							<select size="1" name="filter_country" id="filter_country">
								<option value="0">Выберите страну</option>
								<?php foreach($countries as $country){ ?>
									<option value="<?php echo $country->id; ?>"><?php echo $country->name; ?></option>
								<?php } ?>
							</select>
						</div>
						<div class="form_head">Возраст</div>
						<div class="select_block short">
							<select size="1" name="filter_age_from" id="filter_age_from" class="">
								<option value="0">От</option>
								<option value="10">10</option>
								<option value="15">15</option>
								<option value="17">17</option>
								<option value="18">18</option>
								<option value="20">20</option>
								<option value="22">22</option>
								<option value="25">25</option>
								<option value="28">28</option>
							</select>
						</div>
						<span class="select_bullit">&mdash;</span>
						<div class="select_block short">
							<select size="1" name="filter_age_to" id="filter_age_to" class="">
								<option value="0">До</option>
								<option value="15">15</option>
								<option value="17">17</option>
								<option value="18">18</option>
								<option value="20">20</option>
								<option value="22">22</option>
								<option value="25">25</option>
								<option value="28">28</option>
								<option value="30">30</option>
							</select>
						</div>
						<div class="clear"></div>
						<div class="checkbox_row">
							<div class="form_head">Пол</div>
							<div class="radio_block filter_sex_click">
								<div></div>
								<input type="radio" name="filter_sex" class="radio_item filter_sex" id="radio_female" value="W" />
								<label for="checkbox_female">Женский</label>
							</div>
							<div class="radio_block filter_sex_click">
								<div></div>
								<input type="radio" name="filter_sex" class="radio_item filter_sex" id="radio_male" value="M" />
								<label for="checkbox_male">Мужской</label>
							</div>
							<div class="radio_block filter_sex_click checked">
								<div></div>
								<input type="radio" name="filter_sex" class="radio_item filter_sex" id="radio_other" value="0" checked="checked" />
								<label for="checkbox_other">Любой</label>
							</div>
						</div>
					</form>
				</div>
				<div class="filter_l serchList">
					<?php $this->renderPartial('_onlineFriendsList',array(
						'people' => $data,
						'limit' => $limit,
						'offset' => $offset,
						'profile' => $profile								
					)); ?>				
				</div>
			</div>
		<?php } ?>
	</div>
					
	<div class="tab <?php if($current_tab!='requestFriends'){ echo "hidden"; } ?>" id="u_friends_tab3_">
		<div class="cat_head">
			<div class="cat_head_strip"></div>
			<div class="cat_head_h t"><p class="cat_head_h_txt">У вас <span><?php echo $countData['total']; ?></span> заявок в друзья</p></div>
		</div>
		<?php if($current_tab=='requestFriends'){ ?>
			<div class="filter_block">
				<div class="filter_r">
					<form action="<?php echo Yii::app()->createAbsoluteUrl('people/getrequestfriends', array('limit'=>$limit, 'profile'=>$profile)); ?>" class="filter">
						<div class="form_head">Страна</div>
						<div class="select_block long">
							<select size="1" name="filter_country" id="filter_country">
								<option value="0">Выберите страну</option>
								<?php foreach($countries as $country){ ?>
									<option value="<?php echo $country->id; ?>"><?php echo $country->name; ?></option>
								<?php } ?>
							</select>
						</div>
						<div class="form_head">Возраст</div>
						<div class="select_block short">
							<select size="1" name="filter_age_from" id="filter_age_from" class="">
								<option value="0">От</option>
								<option value="10">10</option>
								<option value="15">15</option>
								<option value="17">17</option>
								<option value="18">18</option>
								<option value="20">20</option>
								<option value="22">22</option>
								<option value="25">25</option>
								<option value="28">28</option>
							</select>
						</div>
						<span class="select_bullit">&mdash;</span>
						<div class="select_block short">
							<select size="1" name="filter_age_to" id="filter_age_to" class="">
								<option value="0">До</option>
								<option value="15">15</option>
								<option value="17">17</option>
								<option value="18">18</option>
								<option value="20">20</option>
								<option value="22">22</option>
								<option value="25">25</option>
								<option value="28">28</option>
								<option value="30">30</option>
							</select>
						</div>
						<div class="clear"></div>
						<div class="checkbox_row">
							<div class="form_head">Пол</div>
							<div class="radio_block filter_sex_click">
								<div></div>
								<input type="radio" name="filter_sex" class="radio_item filter_sex" id="radio_female" value="W" />
								<label for="checkbox_female">Женский</label>
							</div>
							<div class="radio_block filter_sex_click">
								<div></div>
								<input type="radio" name="filter_sex" class="radio_item filter_sex" id="radio_male" value="M" />
								<label for="checkbox_male">Мужской</label>
							</div>
							<div class="radio_block filter_sex_click checked">
								<div></div>
								<input type="radio" name="filter_sex" class="radio_item filter_sex" id="radio_other" value="0" checked="checked" />
								<label for="checkbox_other">Любой</label>
							</div>
						</div>
					</form>
				</div>
				<div class="filter_l serchList">
					<?php $this->renderPartial('_requestFriendsList',array(
						'people' => $data,
						'limit' => $limit,
						'offset' => $offset,
						'profile' => $profile								
					)); ?>				
				</div>
			</div>
		<?php } ?>
	</div>
	<div class="clear"></div>
</div>